package com.youaishujuhui.devops.web.util;

import java.net.InetAddress;

public class NetworkTool {

	public static boolean ping(String ipAddress) {
        int timeOut = 1000 ;    
        
        // 当返回值是true时，说明host是可用的，false则不可。
        boolean status = false;
		try {
			status = InetAddress.getByName(ipAddress).isReachable(timeOut);
		} catch (Exception e) {
			
		}   
        return status;
    }
	
	public static void main(String[] args) {
		System.out.println(ping("212.64.32.247"));
	}
}
